define(['egis'], function (egis) {
    Window.deserializer = Window.deserializer || new egis.core.Deserializer();
    Window.container = Window.container || {};
    dsBridge.register('create_RestWRCSService', function (sourceId, url, http, authType, clientId, clientSecret,tokenUrl) {
        var restHttp = Window.container[http];
        var restGeoService = new egis.ews.RestWRCSService({
            url: url,
            http: restHttp,
            deserializer: Window.deserializer,
            authType: authType,
            clientId: clientId,
            clientSecret: clientSecret,
            tokenUrl:tokenUrl
        });
        Window.container[sourceId] = restGeoService;
    })

//    dsBridge.registerAsyn('RestWRCSService_list', function (sourceId, responseCallback) {
//        var restWRCSService = Window.container[sourceId];
//        restWRCSService.list().then(function (value) {
//            responseCallback(JSON.stringify(value));
//        })
//    })

    dsBridge.registerAsyn('RestWRCSService_find', function (sourceId, layer, responseCallback) {
        var restWRCSService = Window.container[sourceId];
        restWRCSService.find(layer).then(function (value) {
            responseCallback(JSON.stringify(value));
        })
    })

})